<?php
/**
 * User: onwer
 * Date: 12-4-7
 * Time: 上午12:44
 */


require 'lib/lib.php';
include 'islogin.php';

$actinfo='';
$include_src='';
$f_title='';
$act=isset($_GET['act'])?$_GET['act']:'';
$fileManage=new FileManage();
$curdir=isset($_GET['curdir'])?urldecode($_GET['curdir']):'/';
$name=isset($_GET['name'])?urldecode($_GET['name']):'';


switch ($act){
    case 'openfile':{
        if(isset($_POST['filecont'])){
            if($fileManage->write($curdir.$name,$_POST['filecont'])){
                $actinfo=Fun::echoinfo('文件修改成功！','succeed');
            }else{
                $actinfo=Fun::echoinfo('文件修改失败！','error');
            }
        }
        $fileManage->setcurarr($curdir);
        $filecont=$fileManage->open($curdir.$name);
        $include_src = 'file_alt.php';
        break;
    }
    case 'opendir':{
        $curdir=$curdir.$name;
    }

    default:{
        $filearr=$fileManage->getCur($curdir);
        $include_src = 'file_show.php';
    }
}

include ADMIN_ABS_TPL_SRC.'index.php';

